# Audio Compressor-API Access
It can be used to narrow the loudness gap in audio, effectively prevent the generation of whistling, and is an efficient audio dynamic range.
# Task Creation
Create an algorithm task based on the input parameters and return the task id
# Request Address
/v3/pic/eac/batch
# Request Parameter
Method
post
Header
Field | Required | Type | Value | Description |
---|---|---|---|---|
Content-Type | YES | string | application/json | |
Authorization | YES | string | Basic xxxxxxxxx | Basic base64 (appkey:appsecret) created by users combining appkey and secret |
Body
Field | Son Field | Required | Type | Value | Description |
---|---|---|---|---|---|
file_link | - | YES | string | Cloud storage address of audio file | |
file_info | - | YES | object | Audio file information | |
- | file_size | YES | number | File size, with unit of byte | |
- | file_md5 | YES | string | MD5 value of audio file | |
- | file_time | YES | number | integer (int) audio duration, with unit of seconds (s) | |
- | file_ext | YES | string | Audio file format, wav | |
threshold | - | YES | number | Threshold value, -60~60, default value is -21 | |
ratio | - | YES | number | Ratio, 1~10, default value is 5 | |
attack_time | - | YES | number | Attack time, 0.0001~0.01(0.1ms~10ms), default value is 0.0100 | |
release_time | - | YES | number | Release time, 0.01~0.5(10ms~500ms), default value is 0.2000 | |
file_ext | - | NO | string | Need to generate file format, only support mp3 and wav, default of mp3 | |
priority | - | YES | integer | Priority, range [0,9] |
Sample Code
{
"file_link": "Downloadable audio file link",
"file_ext": "wav",
"file_info": {
"file_size": 10778976,
"file_md5": "1bf1f1e6f112b2fb5836c1c3abcb5411",
"file_time": 168,
"file_ext": "wav"
},
"threshold": -21,
"ratio": 5,
"attack_time": 0.01,
"release_time": 0.02,
"priority": 1
}
# Input File Restriction
Audio Format | Audio Size | Audio Length |
---|---|---|
MP3 WAV | No more than 50 MB |
# Return Data
Body
Field | Son Field | Required | Type | Value | Description |
---|---|---|---|---|---|
code | - | YES | number | Status Code | |
msg | - | YES | string | Request Information | |
data | - | YES | object | Response Data | |
- | task_id | YES | string | Task id |
Sample Code
{
"code": 0,
"msg": "",
"data": {
"task_id": "6a4eab77-be30-430a-bf0e-3048042a34ef"
}
}
# Result Acquisition
Request task processing result based on task id
# Request Address
/v3/pic/eac/result/{stask_id}
# Request Parameter
Method
get
Header
Field | Required | Type | Value | Description |
---|---|---|---|---|
Content-Type | YES | string | application/json | |
Authorization | YES | string | Basic xxxxxxxxx | Basic base64 (appkey:appsecret) created by users combining appkey and secret |
Path Parameter
Field | Son Field | Required | Type | Value | Description |
---|---|---|---|---|---|
task_id | - | YES | string | Task id |
# Return Data
Body
Field | Son Field | Required | Type | Value | Description |
---|---|---|---|---|---|
code | - | YES | number | Status Code | |
msg | - | YES | string | Request Information | |
data | - | YES | object | Response Data | |
- | status | YES | string | Task Status: 1- Waiting; 2 - In progress; 3 - Task complete; 4 - Task failure; 5 - Task closed; 6 - Task timed out | |
- | wait_time | YES | string | The waiting time before the next request, with unit of s | |
- | voice_result | YES | string | Audio download link after processing | |
- | reason | YES | string | Cause of failure |